/* flex */
.flx-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flx-justify-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.flx-align-center {
  display: flex;
  align-items: center;
}

/* clearfix */
.clearfix::after {
  display: block;
  height: 0;
  overflow: hidden;
  clear: both;
  content: '';
}

/* 文字单行省略号 */
.sle {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* 文字多行省略号 */
.mle {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* 文字多了自動換行 */
.break-word {
  word-break: break-all;
  word-wrap: break-word;
}

/* fade-transform */
.fade-transform-leave-active,
.fade-transform-enter-active {
  transition: all 0.2s;
}

.fade-transform-enter-from {
  opacity: 0;
  transition: all 0.2s;
  transform: translateX(-30px);
}

.fade-transform-leave-to {
  opacity: 0;
  transition: all 0.2s;
  transform: translateX(30px);
}

/* Breadcrumb */
.breadcrumb-enter-active,
.breadcrumb-leave-active {
  transition: all 0.2s ease;
}

.breadcrumb-enter-from,
.breadcrumb-leave-active {
  opacity: 0;
  transform: translateX(10px);
}

.breadcrumb-leave-active {
  position: absolute;
  z-index: -1;
}

/* scroll bar */
::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-thumb {
  background-color: #d3d3d3;
  border-radius: 20px;
  box-shadow: inset 0 0 0 white;
}

/* nprogress样式 */
#nprogress .bar {
  background: var(--el-color-primary) !important;
}

#nprogress .spinner-icon {
  border-top-color: var(--el-color-primary) !important;
  border-left-color: var(--el-color-primary) !important;
}

#nprogress .peg {
  box-shadow:
    0 0 10px var(--el-color-primary),
    0 0 5px var(--el-color-primary) !important;
}

/* 外边距、内边距全局样式 */
.loop(@i) when (@i >= 0) {
  .mt-@{i} {
    margin-top: (@i * 1px) !important;
  }

  .mb-@{i} {
    margin-bottom: (@i * 1px) !important;
  }

  .ml-@{i} {
    margin-left: (@i * 1px) !important;
  }

  .mr-@{i} {
    margin-right: (@i * 1px) !important;
  }

  .pt-@{i} {
    padding-top: (@i * 1px) !important;
  }

  .pb-@{i} {
    padding-bottom: (@i * 1px) !important;
  }

  .pl-@{i} {
    padding-left: (@i * 1px) !important;
  }

  .pr-@{i} {
    padding-right: (@i * 1px) !important;
  }

  // 递归调用（@i - 1 递减）
  .loop(@i - 1);
}

@font-face {
  font-family: DingTalk;
  font-style: normal;
  font-weight: normal;
  src:
    url('../assets/iconfont/DingTalk-JinBuTi.ttf') format('ttf'),
    url('../assets/iconfont/DingTalk-JinBuTi.woff') format('woff'),
    url('../assets/iconfont/DingTalk-JinBuTi.woff2') format('woff2');
}
